// @dart=2.12
import 'package:floor/floor.dart';

import '../../net/response/patrol/patrol_point_data.dart';
@entity
class PatrolTaskPointData {
  PatrolTaskPointData(
      {this.status,
      this.patrolName,
      this.patrolRange,
      this.startTime,
      this.endTime,
      this.taskId,
      this.statusName,
      this.require,
      this.resultStatusName,
      this.executeTaskId,
      this.pointId,
      this.pointName,
      this.executeDate,
      this.executeBy,
      this.executeByName,
      this.resultStatus,
      this.feedback,
      this.branchId,
      this.id,
      this.createdBy,
      this.createdDate,
      this.updatedBy,
      this.updatedDate,
      this.qrcode,
      this.guardRequire,
      this.taskName});

  PatrolTaskPointData.fromJson(dynamic json) {
    status = json['status'];
    patrolName = json['patrolName'];
    patrolRange = json['patrolRange'];
    startTime = json['startTime'];
    endTime = json['endTime'];
    taskId = json['taskId'];
    statusName = json['statusName'];
    require = json['require'];
    resultStatusName = json['resultStatusName'];
    executeTaskId = json['executeTaskId'];
    pointId = json['pointId'];
    pointName = json['pointName'];
    executeDate = json['executeDate'];
    executeBy = json['executeBy'];
    executeByName = json['executeByName'];
    resultStatus = json['resultStatus'];
    feedback = json['feedback'];
    branchId = json['branchId'];
    id = json['id'];
    createdBy = json['createdBy'];
    createdDate = json['createdDate'];
    updatedBy = json['updatedBy'];
    updatedDate = json['updatedDate'];
    taskName = json['taskName'];
    // qrcode = json['qrcode'];
    // guardRequire = json['guardRequire'];
    var point = json['point'] != null ? Point.fromJson(json['point']) : null;
    if(point!=null){
      qrcode = point.qrcode;
      guardRequire = point.guardRequire;
    }
  }

  int?  status;
  String? patrolName;
  String? patrolRange;
  String? startTime;
  String? endTime;
  int? taskId;
  String? taskName;
  String? statusName;
  String? require;
  String? resultStatusName;
  int?  executeTaskId;
  int?  pointId;
  String? pointName;
  String? executeDate;
  int? executeBy;
  String? executeByName;
  int?  resultStatus;
  String? feedback;
  int? branchId;
  @primaryKey
  int? id;
  String? createdBy;
  String? createdDate;
  String? updatedBy;
  String? updatedDate;
  String? qrcode;
  String? guardRequire;

  PatrolTaskPointData copyWith({
    int?  status,
    dynamic patrolName,
    dynamic patrolRange,
    dynamic startTime,
    dynamic endTime,
    dynamic taskId,
    String? statusName,
    dynamic require,
    String? resultStatusName,
    int? executeTaskId,
    int?  pointId,
    String? pointName,
    dynamic executeDate,
    dynamic executeBy,
    dynamic executeByName,
    int?  resultStatus,
    dynamic feedback,
    dynamic branchId,
    int?  id,
    String? createdBy,
    String? createdDate,
    String? updatedBy,
    String? updatedDate,
    String? qrcode,
    String? guardRequire,
  }) =>
      PatrolTaskPointData(
        status: status ?? this.status,
        patrolName: patrolName ?? this.patrolName,
        patrolRange: patrolRange ?? this.patrolRange,
        startTime: startTime ?? this.startTime,
        endTime: endTime ?? this.endTime,
        taskId: taskId ?? this.taskId,
        statusName: statusName ?? this.statusName,
        require: require ?? this.require,
        resultStatusName: resultStatusName ?? this.resultStatusName,
        executeTaskId: executeTaskId ?? this.executeTaskId,
        pointId: pointId ?? this.pointId,
        pointName: pointName ?? this.pointName,
        executeDate: executeDate ?? this.executeDate,
        executeBy: executeBy ?? this.executeBy,
        executeByName: executeByName ?? this.executeByName,
        resultStatus: resultStatus ?? this.resultStatus,
        feedback: feedback ?? this.feedback,
        branchId: branchId ?? this.branchId,
        id: id ?? this.id,
        createdBy: createdBy ?? this.createdBy,
        createdDate: createdDate ?? this.createdDate,
        updatedBy: updatedBy ?? this.updatedBy,
        updatedDate: updatedDate ?? this.updatedDate,
        qrcode: qrcode ?? this.qrcode,
        guardRequire: guardRequire ?? this.guardRequire,
        taskName: taskName ?? this.taskName,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['status'] = status;
    map['patrolName'] = patrolName;
    map['patrolRange'] = patrolRange;
    map['startTime'] = startTime;
    map['endTime'] = endTime;
    map['taskId'] = taskId;
    map['statusName'] = statusName;
    map['require'] = require;
    map['resultStatusName'] = resultStatusName;
    map['executeTaskId'] = executeTaskId;
    map['pointId'] = pointId;
    map['pointName'] = pointName;
    map['executeDate'] = executeDate;
    map['executeBy'] = executeBy;
    map['executeByName'] = executeByName;
    map['resultStatus'] = resultStatus;
    map['feedback'] = feedback;
    map['branchId'] = branchId;
    map['id'] = id;
    map['createdBy'] = createdBy;
    map['createdDate'] = createdDate;
    map['updatedBy'] = updatedBy;
    map['updatedDate'] = updatedDate;
    map['qrcode'] = qrcode;
    map['guardRequire'] = guardRequire;
    map['taskName'] = taskName;
    return map;
  }
}
